const TOKEN_KEY = 'fanke_token';
const USER_KEY = 'fanke_username';
const USER_TOTALCOUNT = 'fanke_totalcount';
const USER_ADDRESS = 'fanke_address';

//获取token
export function getToken(){
    return localStorage.getItem(TOKEN_KEY) || ""
}

//设置token
export function setToken(token){
    return localStorage.setItem(TOKEN_KEY,token)
}

//获取username
export function getUser(){
    return localStorage.getItem(USER_KEY) || ""
}

//设置username
export function setUser(username){
    return localStorage.setItem(USER_KEY,username)
}
//设置totalcount
export function setTotalCount(count){
    return localStorage.setItem(USER_TOTALCOUNT,count)
}

// 获取totalcount
export function getTotalCount(){
    return localStorage.getItem(USER_TOTALCOUNT) || ""
}
//设置phonenum
export function setAddRess(obj){
    return localStorage.setItem(USER_ADDRESS,obj)
}

// 获取phonenum
export function getAddRess(){
    return localStorage.getItem(USER_ADDRESS) || ""
}

//删除本地信息；退出
export function logOut(){
    localStorage.removeItem(TOKEN_KEY)
    localStorage.removeItem(USER_KEY)
    localStorage.removeItem(USER_ADDRESS)
    localStorage.removeItem(USER_TOTALCOUNT)
}